<?php

namespace App\Http\Requests\Api;

use Illuminate\Foundation\Http\FormRequest;

class AuthorizationRequest extends FormRequest
{
    public function rules()
    {
        return [
            'code' => 'required',
            'nickname' => 'required',
            'sex' => 'required|numeric',
            'avatar' => 'required',
        ];
    }

    public function messages()
    {
        return [
            'code.required' => 'CODE必填',
            'nickname.required' => '昵称必填',
            'sex.required' => '性别必填',
            'sex.numeric' => '性别格式错误',
            'avatar.required' => '头像必填',
        ];
    }
}
